package com.tsing.basic.init;

import com.tsing.basic.mapper.PermissionMapper;
import com.tsing.common.service.UserRedisService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ShiroUrlInit implements InitializingBean {

    @Autowired
    private UserRedisService userRedisService;

    @Resource
    private PermissionMapper permissionMapper;

    @Override
    public void afterPropertiesSet() {
        userRedisService.savePermission2Redis(permissionMapper.selectAllpermission());
    }

}
